package com.ruoyi.client.controller;

import com.ruoyi.client.pojo.vo.CategoryVo;
import com.ruoyi.client.service.ICategoryService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品分类Controller
 *
 * @author HuaQP
 * @date 2024-09-14
 */
@Anonymous
@Api(tags = "03.商品分类")
@RestController("ClientCategoryController")
@RequestMapping("/category")
public class CategoryController extends BaseController
{
    @Resource
    private ICategoryService categoryService;

    /**
     * 查询商品分类列表
     */
    @ApiOperation("获取商品分类列表")
    @GetMapping("/list")
    public R<List<CategoryVo>> list()
    {
        List<CategoryVo> list = categoryService.selectCategoryVoList();
        return R.ok(list);
    }

}
